<?php 
header ("content-type: text/xml");

?>	
<channel>
	<items>
		<?php
//			$link	=	APPRouter::build(APPURI::root().'index.php?app=feed&task=content&id='.$item->id.'-'.$alias);
			$intro	=	stdContent($content->introtext);			
			$full	=	stdContent($content->fulltext);			
			$thumb	=	$href->process_url($content->urlThumb, APPURI::root());
			?>
			<item>
				<title><?php echo stdContent(strip_tags($content->title)); ?></title>
				<thumb src="<?php echo $thumb; ?>" />
				<intro><?php echo $intro; ?></intro>
				<fulltext><?php echo $full; ?></fulltext>
				<date><?php echo $content->date_original; ?></date>
				<images>
					<?php 
						for($i=0; $i<count($images); $i++)
						{
							$image	=	$images[$i];
							$src	=	$href->process_url($image->url, APPURI::root());
							?>
								<image src="<?php echo $src; ?>" title="<?php echo str_replace('"','',strip_tags($image->title)); ?>" />
							<?php
						}
					
					?>
				</images>
			</item>
	</items>
</channel>

<?php 
function stdContent($str_in)
{
	$href	=	new href();
	$str_in	=	preg_replace('/<img[^\>]+src=("|\'|\s*)([^>"\']+)("|\'|\s*)[^\>]+>/ism','<img src="$2" />',$str_in);
	$str_in	=	preg_replace('/<br>/ism',"",$str_in);
	$str_in	=	preg_replace('/<br\s*\/>/ism',"",$str_in);
	$str_in	=	$href->process_src($str_in,APPURI::root());
	$str_in	=	str_replace('&nbsp;',' ', $str_in);	
	$str_in	=	str_replace('&','&amp;', $str_in);
	return $str_in;
}
?>